object MainSingle extends App{
    val end = 1000000
    val length = 4
  
    val startTime = System.currentTimeMillis();
    
	for (i <- 1 to end)
	{
	    var sum = 0;
	    for (j <- i to (i + (length - 1)))
	    {
	      //print((j))
	      //print(" +")
	      sum = sum + (j * j)
	    }
	    
	    //println(" = " + sum)
	    val result = Math.sqrt(sum);
	    val myInt = result.toInt
	    
	    val sum2 = myInt * myInt
	    
	    if (sum == sum2)
	    {
	      println(i);
	    }
	}
	
	val endTime   = System.currentTimeMillis();
	val totalTime = (endTime - startTime);
	println("Time: " + totalTime + " ms");
}